#pragma once

#include "pch.h"

struct UserInfo
{
	std::string m_User;
	std::string m_Host;
};

struct UserDeleteInfo :public UserInfo
{
	static std::string SqlTemp()
	{
		return R"(

DROP  USER IF EXISTS '{{{m_User}}}'@'{{{m_Host}}}';
)";
	}
	std::string Sql() const
	{
		kainjow::mustache::mustache m1 = SqlTemp();
		kainjow::mustache::data d1;
		d1.set("m_User", m_User);
		d1.set("m_Host", m_Host);
		return m1.render(d1);
	}
};
struct UserCreateInfo :public UserInfo
{
	std::string m_Password;

	static std::string SqlTemp()
	{
		return R"(

CREATE USER '{{{m_User}}}'@'{{{m_Host}}}' IDENTIFIED BY '{{{m_Password}}}';
)";
	}
	std::string Sql() const
	{
		kainjow::mustache::mustache m1 = SqlTemp();
		kainjow::mustache::data d1;
		d1.set("m_User", m_User);
		d1.set("m_Host", m_Host);
		d1.set("m_Password", m_Password);
		return m1.render(d1);
	}
};